home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 May: Tool Chest / Dev.CD May 98 TC.toast / Tool Chest / Games / Game Sample Code / ZAM 1.0a13 / CoreSource / InitMac.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-16  |  1.0 KB  |  55 lines  |  [TEXT/KAHL]

  1. /*
  2.     9-30-92  • Brigham Stevens
  3.     --------------------------
  4.  
  5.     This file contains the standard witch chant for getting the Mac going
  6. */
  7.  
  8. #include "CoreGlobals.h"
  9.  
  10.  
  11. void SystemCheck(void)
  12. /*
  13.     This routine checks the minimum requirements to execute.
  14.     If it does not return, then the machine does not cut
  15.     the mustard.
  16. */
  17. {
  18.     long    gestResult;
  19.     
  20.     (void) Gestalt(gestaltSystemVersion,&gestResult);
  21.     
  22.     if (gestResult < 0x0700)    {
  23.         ErrMsg("\pRequires System 7 or later!");
  24.         ExitToShell();
  25.     }
  26.  
  27.     /* initialize the color quickdraw flag */    
  28.     (void) Gestalt(gestaltQuickdrawVersion,&gestResult);
  29.     if(gestResult >= gestalt8BitQD) gColorQD = true;
  30. }
  31.  
  32. void InitToolBox(short numberOfMasters)
  33. /*
  34.     pass the number of times you want MoreMasters to be called
  35.     if your app has lots of Handles to allocate
  36.     then call MoreMasters lots of times.
  37. */
  38. {
  39.     
  40.     InitGraf(&thePort);
  41.     InitFonts();
  42.     InitWindows();
  43.     InitMenus();
  44.     InitCursor();
  45.     TEInit();
  46.     FlushEvents(everyEvent, 0);
  47.     InitDialogs(nil);
  48.     
  49.     while(numberOfMasters--)
  50.         MoreMasters();
  51.         
  52.     SystemCheck();
  53.  
  54. }
  55.